package Users;

import java.io.Serializable;

// Klasa przechowuje dane dotyczace klienta
//
// ==========================================

public class Client implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int ID_client;	// identyfikator(automatycznie)
	private String name;	// imi�
	private String surname;	// nazwisko
	private String city;	// miasto / miejscowo��
	private String post;	// poczta
	private String house;	// numer domu
	private String PESEL;	// numer PESEL
	private String ID_card; // numer dowodu osobistego
	private String username;// Nazwa uzytkownika
	private String pass;	// Haslo
	private String email;	// email
	
	public Client(int ID) { // Domyslny klient
		this.setID(ID);
		this.setName("null");
		this.setSurname("null");
		this.setCity("null");
		this.setPost("null");
		this.setHouse("null");
		this.setPESEL("null");
		this.setID_card("null");
		this.setUsername("null");
		this.setPass("null");
		this.setEmail("null");
	}
	
	public Client(int ID, String name, String surname, String city, String post, String house, String PESEL, String ID_card, String username, String pass, String email) {
		this.setID(ID);
		this.setName(name);
		this.setSurname(surname);
		this.setCity(city);
		this.setPost(post);
		this.setHouse(house);
		this.setPESEL(PESEL);
		this.setID_card(ID_card);
		this.setUsername(username);
		this.setPass(pass);
		this.setEmail(email);
	}
	
	// Publiczne metody pobierania i ustawiania danych (do edycji)
	// Mozna dodac sprawdzanie poprawnosci danych itp
	// Tworzyc sposoby dodawania danych (np autonumerowanie)
	
	public int getID(){
		return ID_client;
	}
	public void setID(int ID_client) {
		this.ID_client = ID_client;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSurname() {
		return surname;
	}
	public void setSurname(String surname) {
		this.surname = surname;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getPost() {
		return post;
	}
	public void setPost(String post) {
		this.post = post;
	}
	public String getHouse() {
		return house;
	}
	public void setHouse(String house){
		this.house = house;
	}
	public String getPESEL() {
		return PESEL;
	}
	public void setPESEL(String PESEL) {
		if(PESEL.length() == 11)
			this.PESEL = PESEL;
	}
	public String getID_card() {
		return ID_card;
	}
	public void setID_card(String ID_card) {
		this.ID_card = ID_card;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPass() {
		return pass;
	}
	public void setPass(String pass) {
		this.pass = pass;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	
	public String toString() {
		return "Imi�: " + name + "\nNazwisko: " + surname + "\nMiasto: " + city + 
				"\nNumer domu: " + house + "\nPoczta: " + post + "\nPESEL: " + PESEL + 
				"\nNr dowodu: " + ID_card;
	}
}
